package jaux.tank.generator.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class ConfigUtil {
	
	private static final String CONFIG_FILE = "config.properties";

	private static Properties properties = new Properties();
	
	static {
		try(InputStream in = ClassLoader.getSystemResourceAsStream(CONFIG_FILE)) {
			properties.load(in);
		} catch (IOException e) {
			log.error("load config file error", e);
		}
	}
	
	private ConfigUtil() {}
	
	public static String get(String key) {
		return properties.getProperty(key);
	}

}
